﻿
@{
    ViewBag.Title = "Index";
    Layout = "~/Views/Shared/_Index.cshtml";
}
<style>
    .zdyGirdPanel {
        width: 100%;
        margin: 0px;
        padding: 0px;
        float: left;
    }

    .zdyUL {
        list-style-type: none;
        margin: 5px 0px 0px -3px;
        padding: 0px;
    }

        .zdyUL li {
            float: left;
            list-style: none;
            height: 24px;
            line-height: 22px;
        }

            .zdyUL li a {
                cursor: pointer;
                padding: 5px 10px;
                border-radius: 4px;
                color: #337ab7;
            }

            .zdyUL li i {
                margin-right: 4px;
                font-size: 13px;
                color: #666;
                vertical-align: middle;
                margin-top: -1px;
            }

            .zdyUL li a:hover {
                text-decoration: none;
                background-color: #1ABC9C;
                color: #fff;
            }
</style>
<script>
    var F_OrderId = $.request("F_OrderId");
    var F_CheckId = $.request("F_Id");
    var F_FlowId = $.request("F_FlowId");
    var ApplyType = $.request("ApplyType");
    var F_CheckUserId = $.request("F_CheckUserId");
    var orderF_State = $.request("orderF_State");
    var F_No =$.request("F_No");
    var resultData = {};
    $(function () {
        getItemList();
        gridList();
    });

    function getItemList() {
        resultData = getCache("CHECK_DETAIL");
        if (!resultData || resultData.length <= 0) {
            $.ajax({
                url: "/CheckManager/CheckInfos/GetItemList",
                dataType: "json",
                async: false,
                success: function (data) {
                    resultData = data;
                    setCache("CHECK_DETAIL", data);
                }, error: function (XMLHttpRequest, textStatus, errorThrown) {

                }
            });
        }
    }

    function ReloadGridList() {
        var $gridList = $("#gridList");
        var queryJson = {
            F_OrderId: F_OrderId, F_CheckUserId: F_CheckUserId, F_CheckId: F_CheckId, F_No: F_No
        };
        $gridList.jqGrid('setGridParam', {
            postData: { queryJson: JSON.stringify(queryJson) },
        }).trigger('reloadGrid');
    }

    function gridList() {
        var $gridList = $("#gridList");
        var queryJson = {
            F_OrderId: F_OrderId, F_CheckUserId: F_CheckUserId, F_CheckId: F_CheckId, F_No: F_No
        };
        $gridList.dataGrid({
            url: "/CheckManager/CheckInfos/GetCheckSchedule",
            postData: { queryJson: JSON.stringify(queryJson) },
            height: 520,
            colModel: [
                { label: '单号', name: 'F_OrderId', hidden: true },
                {
                    label: '所在城市', name: 'City', width: 100, align: 'left', formatter: function (cellvalue, options, rowObject) {
                        var html = "";
                        for (var i = 0; i < resultData.City.length; i++) {
                            if (resultData.City[i].F_EnCode == cellvalue) {
                                return resultData.City[i].F_FullName;
                            }
                        }
                        return html;
                    }
                },
                { label: '场地名称', name: 'SiteName', width: 120, align: 'left' },
                { label: '空间名称', name: 'SpaceName', width: 140, align: 'left' },
                { label: '活动开始日期', name: 'F_StartDate', width: 80, align: 'left' },
                { label: '活动结束日期', name: 'F_EndDate', width: 80, align: 'left' },
                {
                    label: '驳回理由', name: 'F_Reason', align: 'left', width: 120, formatter: function (cellvalue, options, rowObject) {
                        var html = "";
                        for (var i = 0; i < resultData.wdqly.length; i++) {
                            if (resultData.wdqly[i].F_ItemCode == cellvalue) {
                                return resultData.wdqly[i].F_ItemName;
                            }
                        }
                        return html;
                    }
                },
                { label: '备注', name: 'remark', align: 'left', width: 150 },
                { label: '申请时间', name: 'F_CreatorTime', align: 'left', width: 120 },
                
                { label: '', name: 'F_Id', hidden: true },
            ],
            pager: "#gridPager",
            viewrecords: true,
            multiselect: false,
            sortname: 'F_Id',
            rowNum: 20,
            rowList: [20, 40, 60],
            ondblClickRow: function (rowid, iRow, iCol, e) {
            },
            loadComplete: function (data) {
            }
        });
    }

    function GetDictionaries(value, type) {
        if (type == "F_ApplyType") {
            for (var i = 0; i < resultData.F_ApplyType.length; i++) {
                if (value == resultData.F_ApplyType[i].F_ItemCode) {
                    return resultData.F_ApplyType[i].F_ItemName;
                }
            }
            return '';
        }
    }
</script>
<div class="zdyGirdPanel">
    <table id="gridList"></table>
    <div id="gridPager"></div>
</div>

